<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link href="../libs/mui.min.css" rel="stylesheet"/>
    <link href="../libs/app.css" rel="stylesheet"/>
    <link href="../css/main.css" rel="stylesheet"/>
    <link href="../css/join.css" rel="stylesheet"/>
</head>

<body>
<!--<div class="head">
    <p>加盟接单</p>
</div>-->
<div class="join-context">
    <div class="join-context-c" id="about">
        <img src="../images/join-back.jpg" alt="" width="100%">
        <button class="join-context1" id="select-bank">我是银行经理</button>
        <button class="join-context2" id="select-work">我是贷款中介</button>
    </div>
</div>

<script src="../libs/mui.min.js"></script>
<script src="../js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="../js/url.js"></script>
<script type="text/javascript">
    function isBusiness() {
        var isBusiness = false;
        $.ajax({
            type: "get",
            url: ur + "rest/partnerController/getPartnerState",
            async: false,
            headers: {
                'X-Token': localStorage.token
            },
            dataType: 'json',
            success: function (data) {
                if (data.meta.code === 'S002') {
                    isBusiness = true;
                } else {
                    isBusiness = false;
                }
            }
        });
        return isBusiness;
    }

    //银行
    $('#select-bank').on('tap', function () {
        if (isBusiness()) {
            mui.toast('您已经是代理商了');
        } else {
            localStorage.fillin_type = '2';
            href('join/select-bank.html', 'select-bank.html');
        }
    })
    //贷款中介
    $('#select-work').on('tap', function () {
        if (isBusiness()) {
            mui.toast('您已经是代理商了');
        } else {
            localStorage.fillin_type = '1';
            localStorage.bank = '';
            href('join/fill-in.html', 'fill-in.html');
        }
    })

</script>
</body>
</html>